<?php
echo $this->Html->script(array(
	'plugins/select/select2.min',
	'plugins/validationEngine/languages/jquery.validationEngine-en.js',
	'plugins/validationEngine/jquery.validationEngine.js'
		), array('inline' => false));
?>
<?php
echo $this->Form->create('Keyword', array(
	'class' => 'validate',
	'action' => 'add',
	'url' => $this->request->here(false),
	'type' => 'post',
	'inputDefaults' => array('label' => false, 'div' => false)));
echo $this->Form->input('Paginate.task', array('style' => 'display:none;', 'value' => '', 'id' => 'task'));
?>
<div class="page-header">
	<div class="icon">
		<span class="ico-pen-2"></span>
	</div>
	<h1><?php echo __('KEYWORD'); ?> <small>
			<?php echo __('Chỉnh sửa từ khóa "%s"', $keyword['Keyword']['name']); ?>,
			<?php
			echo $this->Html->link($keyword['Project']['name'], array(
				'action' => 'index', $keyword['Project']['id']
			));
			?>
		</small></h1>
	<div class="page-toolbar">
		<div class="btn-group ctr-container">
			<button class="btn btn-primary btn-info ctr-back" type="button">
				<span class="ico-remove"></span>
				<?php echo __('Back'); ?>
			</button>
			<button class="btn btn-primary ctr-save" type="submit">
				<span class="ico-add"></span>
				<?php echo __('Save'); ?>
			</button>
		</div>
	</div>
</div>
<div class="row-fluid">
	<?php echo $this->Session->flash(); ?>
</div>
<div class="row-fluid">

	<div class="span6">                

		<div class="block">
			<div class="head">                                
				<h2><?php echo __('Thông tin cơ bản'); ?></h2>                     
			</div>                                        
			<div class="data-fluid">

				<div class="row-form">
					<div class="span3"><?php echo __('Tên từ khóa'); ?>:</div>
					<div class="span9">
						<div class="input-prepend">
							<span class="add-on"><i class="icon-font icon-white"></i></span>
							<?php
							echo $this->Form->input('name', array('type' => 'text', 'class' => 'validate[required,minSize[3],maxSize[64]]'));
							?>              
						</div>                  
						<span class="bottom"></span>
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Dự án'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('project_id', array('style' => 'width:100%;', 'class' => 'validate[required]', 'type' => 'select', 'class' => 'select'));
						?>
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Danh sách URL'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('url', array('class' => 'validate[required]', 'type' => 'textarea', 'style' => 'height: 100px;'));
						?>
						<span class="bottom"><?php echo __('Nhập mỗi URL trên một dòng'); ?></span>
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Mô tả/ Ghi chú'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('description', array('type' => 'textarea', 'style' => 'height: 100px;'));
						?>
					</div>
				</div>
			</div>
		</div>

	</div>

	<div class="span6">                

		<div class="block">
			<div class="head">                                
				<h2><?php echo __('Thông tin Rank'); ?></h2>                                                            
			</div>                                    
			<div class="data-fluid">

				<div class="row-form">
					<div class="span3"><?php echo __('Current'); ?>:</div>
					<div class="span9">
						<div class="input-prepend">
							<span class="add-on"><i class="icon-star-empty icon-white"></i></span>
							<?php
							echo $this->Form->input('rank_current', array('maxlength' => 4, 'type' => 'text', 'default' => 0, 'class' => 'validate[custom[integer],min[0],max[100]]'));
							?>
						</div>
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Start'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('rank_start', array('maxlength' => 4, 'type' => 'text', 'default' => 0, 'class' => 'spinner validate[custom[integer],min[0],max[100]]'));
						?>
					</div>
				</div>

				<div class="row-form">
					<div class="span3"><?php echo __('Top'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('rank_top', array('maxlength' => 4, 'type' => 'text', 'default' => 0, 'class' => 'spinner validate[custom[integer],min[0],max[100]]'));
						?>
					</div>
				</div>

			</div>                
		</div>


		<div class="block">
			<div class="head">                                
				<h2><?php echo __('Thông tin khác'); ?></h2>                                                            
			</div>                                    
			<div class="data-fluid">

				<div class="row-form">
					<div class="span3"><?php echo __('Ngày bắt đầu'); ?>:</div>
					<div class="span9">
						<div class="input-prepend">
							<span class="add-on"><i class="icon-calendar icon-white"></i></span>
							<?php
							echo $this->Form->input('start_date', array('default' => date('Y-m-d'), 'type' => 'text', 'class' => 'datepicker validate[custom[date]]'));
							?>
						</div>
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Thời hạn (ngày)'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('expired', array('type' => 'text', 'default' => 0, 'class' => 'spinner validate[custom[integer],min[0]]'));
						?>
					</div>
				</div>

			</div>                
		</div>

	</div>     

	<div class="span11">
		<div class="span6">
			<div class="span3">&nbsp;</div>
			<div class="span9">
				<div class="btn-group ctr-container">
					<button class="btn btn-large btn-info" type="reset" onClick="$(this).closest('form').validationEngine('hide');"><?php echo __('Reset'); ?></button>
					<button class="btn btn-large btn ctr-save" type="submit"><?php echo __('Submit'); ?></button>
				</div>
			</div>
		</div>
	</div>

</div>
<?php echo $this->Form->end(); ?>